package com.konke.smartpad_huahao.UI.model;

import com.konke.sdslibrary.model.UniformDeviceType;
import com.sds.sdk.android.sh.model.DeviceStatus;

import java.io.Serializable;

public class RoomDevice implements Serializable {
    private String id;
    private String name;
    private String enName;
    private boolean isTitle;
    private UniformDeviceType mDeviceType;
    private DeviceStatus mDeviceStatus;
    private int span;
    private boolean isShow;
    private int titleIndex;
    private int maxIndex;
    private boolean isControl;
    private int roomId;
    private String icon;

    public RoomDevice(String name, boolean isTitle) {
        this.name = name;
        this.isTitle = isTitle;
    }

    public RoomDevice(UniformDeviceType deviceType, DeviceStatus deviceStatus, int span) {
        mDeviceType = deviceType;
        mDeviceStatus = deviceStatus;
        this.span = span;
    }

    public RoomDevice(String id, UniformDeviceType deviceType) {
        this.id = id;
        mDeviceType = deviceType;
    }

    public RoomDevice(String id, String name, String enName, UniformDeviceType deviceType, DeviceStatus deviceStatus) {
        this.id = id;
        this.name = name;
        this.enName = enName;
        mDeviceType = deviceType;
        mDeviceStatus = deviceStatus;
    }

    public RoomDevice(String id, String name, UniformDeviceType deviceType, int span) {
        this.id = id;
        this.name = name;
        mDeviceType = deviceType;
        this.span = span;
    }

    public RoomDevice(String id, String name, String enName, UniformDeviceType deviceType, DeviceStatus deviceStatus, int span) {
        this.id = id;
        this.name = name;
        this.enName = enName;
        mDeviceType = deviceType;
        mDeviceStatus = deviceStatus;
        this.span = span;
    }

    public RoomDevice(String id, String name, String enName, UniformDeviceType deviceType, DeviceStatus deviceStatus, int span, int titleIndex, int maxIndex) {
        this.id = id;
        this.name = name;
        this.enName = enName;
        mDeviceType = deviceType;
        mDeviceStatus = deviceStatus;
        this.span = span;
        this.titleIndex = titleIndex;
        this.maxIndex = maxIndex;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public boolean isControl() {
        return isControl;
    }

    public void setControl(boolean control) {
        isControl = control;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEnName() {
        return enName;
    }

    public void setEnName(String enName) {
        this.enName = enName;
    }

    public boolean isTitle() {
        return isTitle;
    }

    public void setTitle(boolean title) {
        isTitle = title;
    }

    public UniformDeviceType getDeviceType() {
        return mDeviceType;
    }

    public void setDeviceType(UniformDeviceType deviceType) {
        mDeviceType = deviceType;
    }

    public DeviceStatus getDeviceStatus() {
        return mDeviceStatus;
    }

    public void setDeviceStatus(DeviceStatus deviceStatus) {
        mDeviceStatus = deviceStatus;
    }

    public int getSpan() {
        return span;
    }

    public void setSpan(int span) {
        this.span = span;
    }

    public boolean isShow() {
        return isShow;
    }

    public void setShow(boolean show) {
        isShow = show;
    }

    public int getTitleIndex() {
        return titleIndex;
    }

    public void setTitleIndex(int titleIndex) {
        this.titleIndex = titleIndex;
    }

    public int getMaxIndex() {
        return maxIndex;
    }

    public void setMaxIndex(int maxIndex) {
        this.maxIndex = maxIndex;
    }

    public int getRoomId() {
        return roomId;
    }

    public void setRoomId(int roomId) {
        this.roomId = roomId;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof RoomDevice) {
            if (((RoomDevice) obj).getId() != null && ((RoomDevice) obj).getId().equals(this.id) && ((RoomDevice) obj).getDeviceType() != null && ((RoomDevice) obj).getDeviceType().equals(this.mDeviceType)) {
                return true;
            }
        }
        return super.equals(obj);
    }
}
